import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.util.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Pancle
{
    private String color;

    private Integer age;

    private Integer longth;

    private Integer quantity;

    private List<Phone> phoneList;

    public void addOrderList(Phone phone)
    {
        if(CollectionUtils.isEmpty(this.phoneList))
        {
            this.phoneList = new ArrayList<>();
        }
        phoneList.add(phone);
    }
}
